<?php

namespace App\Http\Controllers\Admin;

use App\Http\Controllers\Controller;
use App\Models\Account;
use Illuminate\Http\Request;

class SystemController extends Controller
{
    public function accounts(Request $request){
        $page = $request->input("page",1);
        $pageSize = $request->input("pageSize",20);
        $paginate = Account::query()
            ->orderByDesc("id")
            ->paginate($pageSize,['*'],'page',$page);
        return $this->httpSuccess([
            "total"=>$paginate->total(),
            "items"=>$paginate->items(),
        ]);
    }
}
